<template>
  <div id="app" >
    <loading v-if="isLoading"></loading>
    <transition :name="routerAni">
      <router-view class="router-view"></router-view>
    </transition>
  </div>
</template>

<script>
// import Loader from 'resource-loader'
import loading from '@/components/loading'
import { mapState } from 'vuex'

export default {
  name: 'app',
  components: {
    loading
  },
  computed: mapState(['isLoading', 'routerAni'])
}
</script>

<style lang="scss">
@import './assets/css/config';
#app{
  position:relative;
  width:100%;
  height:100%;
}
.router-view{
  // position: absolute;
  position: fixed !important;
  width:100%;
  height:100%;
  background-color:$bgColor;
  transition: opacity .5s, transform .3s cubic-bezier(0.25,0.1,0.25,1);
}
.slide-left-enter{
  opacity:.5;
  transform: translate3d(100%, 0, 0);
}
.slide-left-leave-active {
  opacity:0;
  transform: translate3d(-33%, 0, 0);
}
.slide-right-enter {
  opacity:.5;
  transform: translate3d(-100%, 0, 0);
}
.slide-right-leave-active {
  opacity:0;
  transform: translate3d(33%, 0, 0);
}
</style>
